package viviendas.gui.Plan.crear;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFormattedTextField;
import javax.swing.JLabel;
import javax.swing.JSpinner;
import javax.swing.JTable;
import javax.swing.JTextField;
import viviendas.gui.tool.LimitarCampoNumerico;

public class IUPlan extends javax.swing.JInternalFrame {

    /** Creates new form IUPlan */
    public IUPlan() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        java.awt.GridBagConstraints gridBagConstraints;

        jPanel1 = new javax.swing.JPanel();
        labNombre = new javax.swing.JLabel();
        labTipoPlan = new javax.swing.JLabel();
        labNroViviendasPorAño = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        texNombre = new javax.swing.JTextField();
        comTipoPlan = new javax.swing.JComboBox();
        spinAños = new javax.swing.JSpinner();
        texTotalViviendas = new javax.swing.JTextField();
        texViviendas = new javax.swing.JTextField();
        labAñoInicio = new javax.swing.JLabel();
        spinAñoInicio = new javax.swing.JSpinner();
        jPanel3 = new javax.swing.JPanel();
        btnAgregar = new javax.swing.JButton();
        btnAgregarTodas = new javax.swing.JButton();
        btnQuitar = new javax.swing.JButton();
        btnQuitarTodas = new javax.swing.JButton();
        formatedTotal = new javax.swing.JFormattedTextField();
        labTotal = new javax.swing.JLabel();
        labRestante = new javax.swing.JLabel();
        texRestante = new javax.swing.JTextField();
        jSeparator1 = new javax.swing.JSeparator();
        jScrollPane1 = new javax.swing.JScrollPane();
        tabProvincias = new viviendas.gui.tool.TableUpdated();
        jScrollPane2 = new javax.swing.JScrollPane();
        tabProvinciasSeleccionadas = new viviendas.gui.tool.TableUpdated();
        btnAceptar = new javax.swing.JButton();
        btnCancelar = new javax.swing.JButton();

        setClosable(true);
        setTitle("Plan de Vivienda");
        setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/viviendas/imagenes/Home.png"))); // NOI18N
        getContentPane().setLayout(new java.awt.GridBagLayout());

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Paso 1: Especificar Datos del Plan", javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.TOP, new java.awt.Font("Dialog", 1, 18))); // NOI18N
        jPanel1.setLayout(new java.awt.GridBagLayout());

        labNombre.setText("Nombre");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 10, 5, 10);
        jPanel1.add(labNombre, gridBagConstraints);

        labTipoPlan.setText("Tipo");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 10, 5, 10);
        jPanel1.add(labTipoPlan, gridBagConstraints);

        labNroViviendasPorAño.setText("Viviendas x Año");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 10, 5, 10);
        jPanel1.add(labNroViviendasPorAño, gridBagConstraints);

        jLabel4.setText("Cantidad Años");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 10, 5, 10);
        jPanel1.add(jLabel4, gridBagConstraints);

        jLabel5.setText("Total Viviendas");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 10);
        jPanel1.add(jLabel5, gridBagConstraints);

        texNombre.setPreferredSize(new java.awt.Dimension(150, 27));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.insets = new java.awt.Insets(5, 10, 5, 10);
        jPanel1.add(texNombre, gridBagConstraints);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 3;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.insets = new java.awt.Insets(5, 10, 5, 10);
        jPanel1.add(comTipoPlan, gridBagConstraints);

        spinAños.setModel(new javax.swing.SpinnerNumberModel(1, 1, 100, 1));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 3;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.insets = new java.awt.Insets(5, 10, 5, 10);
        jPanel1.add(spinAños, gridBagConstraints);

        texTotalViviendas.setEditable(false);
        texTotalViviendas.setEnabled(false);
        texTotalViviendas.setPreferredSize(new java.awt.Dimension(150, 27));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.insets = new java.awt.Insets(5, 10, 5, 10);
        jPanel1.add(texTotalViviendas, gridBagConstraints);

        texViviendas.setMinimumSize(new java.awt.Dimension(150, 27));
        texViviendas.setPreferredSize(new java.awt.Dimension(150, 27));
        texViviendas.setDocument(new LimitarCampoNumerico());
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        jPanel1.add(texViviendas, gridBagConstraints);

        labAñoInicio.setText("Año Inicio");
        jPanel1.add(labAñoInicio, new java.awt.GridBagConstraints());
        jPanel1.add(spinAñoInicio, new java.awt.GridBagConstraints());

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridwidth = 3;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.weighty = 1.0;
        getContentPane().add(jPanel1, gridBagConstraints);

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Paso 2: Agregar Provincias al Plan", javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.TOP, new java.awt.Font("Dialog", 0, 18))); // NOI18N
        jPanel3.setLayout(new java.awt.GridBagLayout());

        btnAgregar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/viviendas/imagenes/poner_16x16.png"))); // NOI18N
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.weighty = 1.0;
        gridBagConstraints.insets = new java.awt.Insets(0, 30, 0, 30);
        jPanel3.add(btnAgregar, gridBagConstraints);

        btnAgregarTodas.setIcon(new javax.swing.ImageIcon(getClass().getResource("/viviendas/imagenes/ponerTodas_16x16.png"))); // NOI18N
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.weighty = 1.0;
        gridBagConstraints.insets = new java.awt.Insets(0, 30, 0, 30);
        jPanel3.add(btnAgregarTodas, gridBagConstraints);

        btnQuitar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/viviendas/imagenes/quitar_16x16.png"))); // NOI18N
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.weighty = 1.0;
        gridBagConstraints.insets = new java.awt.Insets(0, 30, 0, 30);
        jPanel3.add(btnQuitar, gridBagConstraints);

        btnQuitarTodas.setIcon(new javax.swing.ImageIcon(getClass().getResource("/viviendas/imagenes/quitarTodas_16x16.png"))); // NOI18N
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 4;
        gridBagConstraints.weighty = 1.0;
        gridBagConstraints.insets = new java.awt.Insets(0, 30, 0, 30);
        jPanel3.add(btnQuitarTodas, gridBagConstraints);

        formatedTotal.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        formatedTotal.setMinimumSize(new java.awt.Dimension(80, 27));
        formatedTotal.setPreferredSize(new java.awt.Dimension(80, 27));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 5;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 16, 0, 16);
        jPanel3.add(formatedTotal, gridBagConstraints);

        labTotal.setText("% Total:");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 5;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        gridBagConstraints.insets = new java.awt.Insets(0, 16, 0, 16);
        jPanel3.add(labTotal, gridBagConstraints);

        labRestante.setText("% Restante");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 5;
        gridBagConstraints.insets = new java.awt.Insets(0, 6, 0, 6);
        jPanel3.add(labRestante, gridBagConstraints);

        texRestante.setMinimumSize(new java.awt.Dimension(80, 27));
        texRestante.setPreferredSize(new java.awt.Dimension(80, 27));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 3;
        gridBagConstraints.gridy = 5;
        gridBagConstraints.insets = new java.awt.Insets(0, 6, 0, 6);
        jPanel3.add(texRestante, gridBagConstraints);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        jPanel3.add(jSeparator1, gridBagConstraints);

        tabProvincias.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jScrollPane1.setViewportView(tabProvincias);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.gridheight = 5;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.weighty = 1.0;
        jPanel3.add(jScrollPane1, gridBagConstraints);

        tabProvinciasSeleccionadas.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jScrollPane2.setViewportView(tabProvinciasSeleccionadas);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.gridwidth = 4;
        gridBagConstraints.gridheight = 5;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.weighty = 1.0;
        jPanel3.add(jScrollPane2, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.gridwidth = 3;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.weighty = 1.0;
        getContentPane().add(jPanel3, gridBagConstraints);

        btnAceptar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/viviendas/imagenes/Accept.png"))); // NOI18N
        btnAceptar.setText("Aceptar");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 4;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        gridBagConstraints.insets = new java.awt.Insets(15, 15, 15, 15);
        getContentPane().add(btnAceptar, gridBagConstraints);

        btnCancelar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/viviendas/imagenes/Log Out_16x16.png"))); // NOI18N
        btnCancelar.setText("Cancelar");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 4;
        gridBagConstraints.insets = new java.awt.Insets(15, 15, 15, 15);
        getContentPane().add(btnCancelar, gridBagConstraints);

        pack();
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnAceptar;
    private javax.swing.JButton btnAgregar;
    private javax.swing.JButton btnAgregarTodas;
    private javax.swing.JButton btnCancelar;
    private javax.swing.JButton btnQuitar;
    private javax.swing.JButton btnQuitarTodas;
    private javax.swing.JComboBox comTipoPlan;
    private javax.swing.JFormattedTextField formatedTotal;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JLabel labAñoInicio;
    private javax.swing.JLabel labNombre;
    private javax.swing.JLabel labNroViviendasPorAño;
    private javax.swing.JLabel labRestante;
    private javax.swing.JLabel labTipoPlan;
    private javax.swing.JLabel labTotal;
    private javax.swing.JSpinner spinAñoInicio;
    private javax.swing.JSpinner spinAños;
    private javax.swing.JTable tabProvincias;
    private javax.swing.JTable tabProvinciasSeleccionadas;
    private javax.swing.JTextField texNombre;
    private javax.swing.JTextField texRestante;
    private javax.swing.JTextField texTotalViviendas;
    private javax.swing.JTextField texViviendas;
    // End of variables declaration//GEN-END:variables

    

    public JButton getBtnAceptar() {
        return btnAceptar;
    }

    public void setBtnAceptar(JButton btnAceptar) {
        this.btnAceptar = btnAceptar;
    }

    public JButton getBtnAgregar() {
        return btnAgregar;
    }

    public void setBtnAgregar(JButton btnAgregar) {
        this.btnAgregar = btnAgregar;
    }

    public JButton getBtnAgregarTodas() {
        return btnAgregarTodas;
    }

    public void setBtnAgregarTodas(JButton btnAgregarTodas) {
        this.btnAgregarTodas = btnAgregarTodas;
    }

    public JButton getBtnQuitar() {
        return btnQuitar;
    }

    public void setBtnQuitar(JButton btnQuitar) {
        this.btnQuitar = btnQuitar;
    }

    public JButton getBtnQuitarTodas() {
        return btnQuitarTodas;
    }

    public void setBtnQuitarTodas(JButton btnQuitarTodas) {
        this.btnQuitarTodas = btnQuitarTodas;
    }

    public JComboBox getComTipoPlan() {
        return comTipoPlan;
    }

    public void setComTipoPlan(JComboBox comTipoPlan) {
        this.comTipoPlan = comTipoPlan;
    }

    public JTextField getTexViviendas() {
        return texViviendas;
    }

    public void setTexViviendas(JTextField texViviendas) {
        this.texViviendas = texViviendas;
    }

    public JSpinner getSpinAños() {
        return spinAños;
    }

    public void setSpinAños(JSpinner spinAños) {
        this.spinAños = spinAños;
    }

    public JTable getTabProvinciasSeleccionadas() {
        return tabProvinciasSeleccionadas;
    }

    public void setTabProvinciasSeleccionadas(JTable tabProvincias) {
        this.tabProvinciasSeleccionadas = tabProvincias;
    }

    public JTable getTabProvincias() {
        return tabProvincias;
    }

    public void setTabProvincias(JTable tabProvincias) {
        this.tabProvincias = tabProvincias;
    }

    public JTextField getTexNombre() {
        return texNombre;
    }

    public void setTexNombre(JTextField texNombre) {
        this.texNombre = texNombre;
    }

    public JTextField getTexTotalViviendas() {
        return texTotalViviendas;
    }

    public void setTexTotalViviendas(JTextField texTotalViviendas) {
        this.texTotalViviendas = texTotalViviendas;
    }

    public JFormattedTextField getFormatedTotal() {
        return formatedTotal;
    }

    public void setFormatedTotal(JFormattedTextField formatedTotal) {
        this.formatedTotal = formatedTotal;
    }

    public JLabel getLabTotal() {
        return labTotal;
    }

    public void setLabTotal(JLabel labTotal) {
        this.labTotal = labTotal;
    }

    public JLabel getLabRestante() {
        return labRestante;
    }

    public void setLabRestante(JLabel labRestante) {
        this.labRestante = labRestante;
    }

    public JTextField getTexRestante() {
        return texRestante;
    }

    public void setTexRestante(JTextField texRestante) {
        this.texRestante = texRestante;
    }

    public JSpinner getSpinAñoInicio() {
        return spinAñoInicio;
    }

    public void setSpinAñoInicio(JSpinner spinAñoInicio) {
        this.spinAñoInicio = spinAñoInicio;
    }

    public JButton getBtnCancelar() {
        return btnCancelar;
    }

    public void setBtnCancelar(JButton btnCancelar) {
        this.btnCancelar = btnCancelar;
    }
}
